<?php echo $this->content; ?>
<script type="text/javascript">
$(document).ready(function()
{
	$('#mediaBlockFiles').find('.pagination a').click(function(){
		$.ajax({url: this.href,
				dataType: 'json',
				type: 'get',
				success: function(data){
							HandleResponseJSON(data, function(data){
								LoadMediaFilesBlock(data);
							});
						}
		});
		return false;
	});

	$('#mediaBlockFiles').find('.drag-media-thumb').draggable({
		helper: function(){
			return $(this).clone().appendTo('body');
		},
		cursorAt: {top:0, left:0},
		zIndex: 1000,
		cursor: 'move',
		iframeFix: true,
		addClasses: false,
		scope: 'mediafile'
	}).disableSelection();

	<?php
	if ($this->params['contentButton'])
	{
	?>
	$('#mediaBlockFiles a.icon-arrow-right').click(function(){
		addMediaToContent($(this).data('id'));
		return false;
	});
	<?php
	}
	?>
});
</script>